#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time         : 17-12-12 下午4:29
# @Author       : xiaohan
# @File         : filters.py
# @desc         : 

from django_filters import rest_framework as filters

from apps.user.models import UserProfile


class UserFilter(filters.FilterSet):
    '''
        过滤功能
    '''
    name = filters.CharFilter(name="name", lookup_expr='icontains')
    phone = filters.CharFilter(name="phone", lookup_expr='icontains')

    class Meta:
        model = UserProfile
        fields = ['name', 'phone']
